<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2023/12/12
 * Time: 10:10
 */

namespace app\api\model;

class UUser extends Base
{
    /**
     * 用户查询
     * @param $where
     * @param $field
     * @return array|bool|\PDOStatement|string|\think\Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    static function findUser($where = [], $field = '*'){
        return self::where($where)->field($field)->find();
    }

    /**
     * 新增用户
     * @param $insert
     * @return int|string
     */
    static function insertUser($insert = []){
        return self::insert($insert);
    }

    /**
     * 更新用户
     * @param $where
     * @param $update
     * @return UUser
     */
    static function updateUser($where = [], $update = []){
        return self::where($where)->update($update);
    }
}